1. Field of the Invention
The present invention relates to circuit simulation of a semiconductor integrated circuit, and more specifically, to a circuit simulation method in a designing process of the semiconductor integrated circuit, and a circuit simulation system.
2. Description of Related Art
In recent years, the scale of a semiconductor integrated circuit has been made large and a time necessary to analyze a circuit is increasing in the design and development of the semiconductor integrated circuit. A circuit simulation program such as SPICE is frequently used for the analysis of the circuit. An analyzing method in the SPICE is well known, and is shown in the Web Site (http://embedded.eecs.berkeley.edu/pubs/downloads/spice/index.htm). Although there is no flowchart, a source code of the SPICE has been opened.
A circuit simulation method of analyzing a circuit at high speed by using the SPICE is disclosed in Japanese Patent Application Publications (JP-A-Heisei 10-222555, JP-A-Heisei 11-110420, JP-P2006-133994A. In Japanese Patent Application Publication (JP-A-Heisei 10-222555), a circuit is divided into a plurality of sectional circuits and analyzed, and in Japanese Patent Application Publication (JP-A-Heisei 11-110420), a circuit is analyzed in advance while a precision parameter is varied. Japanese Patent Application Publication (JP-P2006-133994A) discloses that a current value or a voltage value is calculated.
In the circuit simulation program represented by SPICE, a circuit equation is generated based on Kirchhoff's voltage law and current law to express connections in the circuit. The circuit equation is represented as a matrix, and the circuit is analyzed through calculation of the matrix. That is, based on data of elements contained in the circuit and data of connections of them, the equation F(X)=0 is defined, in which a solution X (=unknown variable) is a value of a voltage (voltage variable) at each of nodes in the circuit and a value of a current (=current variable) flowing through each of the elements.
An iterative solution method such as the Newton iteration method is generally used for calculation of the solution of the circuit equation. The Newton iteration method is a technique of calculating an approximate solution of a true solution satisfying the equation F(X)=0, by specifying a variable i indicating the number of times of the iteration, and repeating calculation of a value of the ith unknown variable X(i) by using a value of the (i−1)th unknown variable X(i−1). It is called convergence that an amount of change of the unknown variable X settles in a tolerance specified in advance, and a process is completed assuming that the solution has been calculated at that time.
FIG. 4 is a block diagram showing the configuration of a conventional circuit simulation system. Referring to FIG. 4, the conventional circuit simulation system includes a storage unit 1, an analysis processing section 2, and a calculation result outputting unit 7.
The storage unit 1 is exemplified by a hard disk drive and is connected to an I/O interface 4. The storage unit 1 stores a circuit data 10 specifying the circuit configuration such as data indicating elements contained in a circuit and connections of them, and an analysis condition data 20 as a setting data used for performing analysis such as an analysis start time, and an analysis end time. Moreover, an analysis result is stored in the storage unit 1 as a waveform data 40.
The analysis processing section 2 has a CPU 3, an I/O interface 4, a ROM (Read Only Memory) 5, and a RAM (Random Access Memory) 6. In the analysis processing section 2, a circuit simulation program is loaded into the RAM 6 via the CPU 3, and the CPU 3 executes it. An execution result is stored in the storage unit 1 via the I/O interface 4, and is outputted to the calculation result outputting unit 7. The calculation result outputting unit 7 is exemplified by a display, a printer, and a file system, and is connected to the I/O interface 4, and outputs the analysis result of the analysis processing section 2.
Next, an operation method of the conventional circuit simulation system will be described. FIG. 1 is a flowchart showing the conventional circuit simulation method.
First, the circuit simulation is started (Step S100). The circuit data 10 and the analysis condition data 20 are read from the storage unit 1 (Step S101). As described above, the circuit data specifies the configuration of the circuit to be analyzed, and contains data indicating the elements in the circuit and connections of them. The analysis condition data is the setting data for performing analysis, which includes a data indicating the tolerance of accuracy.
Next, an initial value set of the Newton iteration method is set. Moreover, a counter variable i indicates the number of times of the iteration of the Newton iteration method and is set to “1” (Step S102).
A circuit equation is generated based on the circuit data 10, and an approximating process of calculating a solution is executed in which the circuit equation is approximately solved by the Newton iteration method (Step S 103). The process of calculating the solution of the circuit equation is matrix calculation. As the circuit scale becomes larger, the matrix scale becomes larger and the number of times of the operation increases exponentially. Specifically, the number of times of the calculation is the number of times of the updating calculation when erasing variables in a LU (Lower/Upper) decomposition of the circuit matrix into a product of triangular matrixes. It is generally known that the number of times of the calculation increases in proportion to the third power of a matrix size.
It is determined whether the solution of the circuit equation in the approximating process has been converged through the iterative calculation (Step S104). Conditional branching is performed based on a result of convergence determining process (Step S105).
When it is determined that the solution has converged (Yes at Step S105), the solution of the circuit equation is saved as the waveform data 40 in the storage unit 1 (Step S108). Then, the operation follow is completed (Step S109).
When the solution has not converged (No at Step S105), it is determined whether the counter variable i has exceeded a predetermined number of times of the iteration ITL1 (Step S106). When it exceeds an upper limit (Yes at Step S106), it is determined to be in error and the operation flow is completed (Step S107). When it does not exceed the upper limit (No at Step S106), the Step S113 is carried out.
At Step S113, the counter variable i is incremented by “1” (Step S113), and the operation flow returns again to the Step S103. The values calculated at the last Step S103 are used as the initial value set, and the process of calculating a solution is executed, like the last time. Therefore, the number of times of the operation required to calculate the solution can be expressed as follows:(Number of times of the operation required to calculate a solution)=(Number of times of the operation per iteration of Newton iteration method)×(Number of times of the iteration required until convergence)The number of times of the operation per iteration of the Newton iteration method can be found at the Step S103, and the number of times of the iteration of the Newton iteration method required until convergence can be found as a value of the counter variable i at the Step S108. Thus, the number of times of the operation required to calculate the solution can be expressed as a product of these numbers of times. A simulation time is dependent on the number of times of the operation required to calculate the solution.
FIG. 2 is a flowchart showing a convergence determining process of the Step S104 of FIG. 1 in detail. First, when the Step S104 is started (Step S500), a convergence variable flag eflg is initialized to zero (Step S509). The convergence variable flag eflg indicates whether there is a variable that has not converged, among variables of the unknown variable X. When the convergence variable flag eflg is “1,” it indicates that one or more variables included in the unknown variable X are not in a state of non-convergence; and when the convergence variable flag eflg is “0,” it indicates that all the variables are in a state of convergence.
Next, the following process is performed on all the variables included in the unknown variable X. It is evaluated over all the variables whether a difference between the present solution x(i) of the variable x included in the unknown variable X and a last time solution x(i−1) thereof, is within a tolerance (Step S501). When the solution has not converged, it is determined that there is a variable not having converged in the variable X, and the convergence variable flag eflg is set to “1” (Step S507). After that, it is determined whether there is an undetermined variable (Step S502). When there is the undetermined variable (Yes at Step S502), the next variable is evaluated (Step S508). By repeating this, the convergence determining process is made in sequence on all the variables included in the unknown variable X.
When there is no undetermined variable (No at Step S502), the convergence determining process is completed (Step S504).
FIG. 3 is a table showing a convergence determination result. In FIG. 3, “i” represents a value of the counter variable of the Newton iteration method. Regarding “V” and “I,” when a set of voltage variables included in a set of unknown variables X is specified as V (V=(xv|xv is a voltage variable, and X includes xv)) and a set of current variables included in the set of unknown variables X is specified as I (I=(xi|xi is a voltage variable, and X includes xi)). A symbol “O” indicates a case that all the elements in each set have converged, and a symbol “X” indicates a case that any of the elements therein has not converged. Here, X is a logical OR of V and I. A column of “determination” shows the convergence determination result of Step S104.
First, at the Step S103 of FIG. 1, when the counter variable i of the Newton iteration method varies to a value not exceeding an upper limit ITL1 of the number of times of the iteration, i.e., a value (n−1) (n: natural number), the variable sets V and I result in non-convergence. At this time, when the counter variable i is incremented to n, namely when the nth iteration process is executed, the sets V and I of FIG. 3 result in non-convergence. At the Step S103, the generation of the circuit equation and the process of calculating the solution by the Newton iteration method by using the (n−1)th solution as an initial value set are performed.
Next, at the Step S104, it is determined whether a value of Xn−X(n−1) stays in the tolerance, that is, whether a difference between the present solution x(i) and the last solution x(i−1) is within the tolerance for the variable x included in the unknown variable X. Here, in FIG. 3, the set V has converged, but the set I has not converged. Therefore, it is determined that the result of the Step S104 is non-convergence. For this reason, the iteration process for the (n+1)th iteration and succeeding iterations are carried out again. In this way, the Newton iteration method is carried out repeatedly until the solutions included in the set V and the set I are all converged, and the number of times of the iteration required until calculating the solution becomes m (n<m).
The process of calculating the solution at the Step S103 is repeated due to the result of the convergence determining process at the Step S104. Even when the voltage variable has converged, the process of calculating the solution and the convergence determining process are repeated until all the variables have converged.
As described above, in the conventional circuit simulation method, since a predetermined determining process is executed to a change in the variable and the solution, the number of times of the iteration increases and a circuit simulation time elongates depending on a circuit size.
Therefore, a circuit simulation method is demanded in which the number of times of the operation of the Newton iteration method until convergence is attained can be reduced by changing a method of convergence determination based on the solution of a variable included in an unknown variable X, and also, the number of times of the operation required to calculate the solution can be reduced as a whole, and a circuit simulation system therefore.